 export function param(json) {
    if (!json) return ''
    return cleanArray(Object.keys(json).map(key => {
      if (json[key] === undefined) return ''
      return encodeURIComponent(key) + '=' +
             encodeURIComponent(json[key])
    })).join('&')
  }
 
  export function param2Obj(url) {
    const search = url.split('?')[1]
    if (!search) {
      return {}
    }
    return JSON.parse('{"' + decodeURIComponent(search).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g, '":"') + '"}')
  
  }
  export function builddata(menuList){
    var parr=menuList.filter(element => {
				
      return element.parentPrivilegeFunction == null
    });	
    for(var i=0;i<parr.length;i++){

      console.log(parr[i])
      parr[i]['submenus']=menuList.filter(elem=>{
          if(elem.parentPrivilegeFunction!=null){
          return elem.parentPrivilegeFunction.id == parr[i].id;
          }else if(elem.parentPrivilegeFunction.id){
            
          }
          else{
            return false;
          }

      })
    }

  }
  
  
  